<?php
    session_start();
	if ($_GET)
	{
		require('config.php');
		$uuid = $_GET['uuid'];
		$stmt = $connection->prepare("select id, valid from user_forget_password where uuid=?");
		$stmt->bind_param("s", $uuid);
		$stmt->execute();
		$stmt->store_result();
		$row_cnt = $stmt->num_rows;
		if ($row_cnt > 0)
		{
			$time = date("Y-m-d H:i:s");
			$stmt->bind_result($user, $valid);
			$stmt->fetch();
            if ($valid == 0)
            {
			    $stmt = $connection->prepare("update user_forget_password set valid=1 where id=?");
			    $stmt->bind_param("s", $user);
			    $stmt->execute();
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel=stylesheet href="css/forget_password.css" type="text/css">
<script type="text/javascript" src="js/mootools-1.3.2-core.js"></script>
<script type="text/javascript" src="js/mootools-1.3.2.1-more.js"></script>
<script type="text/javascript" src="js/jquery-1.7.min.js"></script>
<script>
    var $j = jQuery.noConflict();
</script>
<script type="text/javascript" src="js/forget_password.js"></script>
<title>修改密码</title>
</head>
<body>
<div id="background" unselectable="on" class="unselectable">
    <div id='changepassword'>
        <div id='logo'><img src='ico/logo4.png' /></div>
        <div id='tip'>请输入新密码</div>
        <div id='password_background'>
        <input id='password' type='password' onblur='inputblur(this)'/>
        <div id='message'></div>
        </div>
        <div id='changePassConfirm' class='changePassConfirmClass' onmouseover='loginButtonMouseOver(this)' onmouseout='loginButtonMouseOut(this)' onmousedown='loginButtonMouseDown(this)' onmouseup='loginButtonMouseUp(this)' onclick='changePassword();'><div style='position:relative; top:10px'>确定</div></div>
    </div>
    <div id='userid' style='visibility:hidden'><?php echo $user; ?></div>
</div>
</body>
</html>
<?php
                return;
            }
		}
        $_SESSION['gate'] = 1;
        $_SESSION['login'] = false;
		header("location: anonymous.php");
	}
	else
	{
        $_SESSION['gate'] = 1;
        $_SESSION['login'] = false;
		header("location: anonymous.php");
	}
	
?>
